<template>
  <div class="row justify-content-center">
    <div class="col-8">
      <form name="editForm" role="form" novalidate v-on:submit.prevent="save()">
        <h2 id="roomAdminApp.roomTransactionProperty.home.createOrEditLabel" data-cy="RoomTransactionPropertyCreateUpdateHeading">
          Create or edit a RoomTransactionProperty
        </h2>
        <div>
          <div class="form-group" v-if="roomTransactionProperty.id">
            <label for="id">ID</label>
            <input type="text" class="form-control" id="id" name="id" v-model="roomTransactionProperty.id" readonly />
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-transaction-property-listingTime">Listing Time</label>
            <b-input-group class="mb-3">
              <b-input-group-prepend>
                <b-form-datepicker
                  aria-controls="room-transaction-property-listingTime"
                  v-model="$v.roomTransactionProperty.listingTime.$model"
                  name="listingTime"
                  class="form-control"
                  :locale="currentLanguage"
                  button-only
                  today-button
                  reset-button
                  close-button
                >
                </b-form-datepicker>
              </b-input-group-prepend>
              <b-form-input
                id="room-transaction-property-listingTime"
                data-cy="listingTime"
                type="text"
                class="form-control"
                name="listingTime"
                :class="{
                  valid: !$v.roomTransactionProperty.listingTime.$invalid,
                  invalid: $v.roomTransactionProperty.listingTime.$invalid,
                }"
                v-model="$v.roomTransactionProperty.listingTime.$model"
              />
            </b-input-group>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-transaction-property-lastTradeTime">Last Trade Time</label>
            <b-input-group class="mb-3">
              <b-input-group-prepend>
                <b-form-datepicker
                  aria-controls="room-transaction-property-lastTradeTime"
                  v-model="$v.roomTransactionProperty.lastTradeTime.$model"
                  name="lastTradeTime"
                  class="form-control"
                  :locale="currentLanguage"
                  button-only
                  today-button
                  reset-button
                  close-button
                >
                </b-form-datepicker>
              </b-input-group-prepend>
              <b-form-input
                id="room-transaction-property-lastTradeTime"
                data-cy="lastTradeTime"
                type="text"
                class="form-control"
                name="lastTradeTime"
                :class="{
                  valid: !$v.roomTransactionProperty.lastTradeTime.$invalid,
                  invalid: $v.roomTransactionProperty.lastTradeTime.$invalid,
                }"
                v-model="$v.roomTransactionProperty.lastTradeTime.$model"
              />
            </b-input-group>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-transaction-property-roomAgeLimit">Room Age Limit</label>
            <input
              type="text"
              class="form-control"
              name="roomAgeLimit"
              id="room-transaction-property-roomAgeLimit"
              data-cy="roomAgeLimit"
              :class="{
                valid: !$v.roomTransactionProperty.roomAgeLimit.$invalid,
                invalid: $v.roomTransactionProperty.roomAgeLimit.$invalid,
              }"
              v-model="$v.roomTransactionProperty.roomAgeLimit.$model"
            />
            <div v-if="$v.roomTransactionProperty.roomAgeLimit.$anyDirty && $v.roomTransactionProperty.roomAgeLimit.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomTransactionProperty.roomAgeLimit.maxLength">
                This field cannot be longer than 16 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-transaction-property-roomMortgage">Room Mortgage</label>
            <input
              type="text"
              class="form-control"
              name="roomMortgage"
              id="room-transaction-property-roomMortgage"
              data-cy="roomMortgage"
              :class="{
                valid: !$v.roomTransactionProperty.roomMortgage.$invalid,
                invalid: $v.roomTransactionProperty.roomMortgage.$invalid,
              }"
              v-model="$v.roomTransactionProperty.roomMortgage.$model"
            />
            <div v-if="$v.roomTransactionProperty.roomMortgage.$anyDirty && $v.roomTransactionProperty.roomMortgage.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomTransactionProperty.roomMortgage.maxLength">
                This field cannot be longer than 16 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-transaction-property-roomTransactionOwnership">Room Transaction Ownership</label>
            <input
              type="text"
              class="form-control"
              name="roomTransactionOwnership"
              id="room-transaction-property-roomTransactionOwnership"
              data-cy="roomTransactionOwnership"
              :class="{
                valid: !$v.roomTransactionProperty.roomTransactionOwnership.$invalid,
                invalid: $v.roomTransactionProperty.roomTransactionOwnership.$invalid,
              }"
              v-model="$v.roomTransactionProperty.roomTransactionOwnership.$model"
            />
            <div
              v-if="
                $v.roomTransactionProperty.roomTransactionOwnership.$anyDirty &&
                $v.roomTransactionProperty.roomTransactionOwnership.$invalid
              "
            >
              <small class="form-text text-danger" v-if="!$v.roomTransactionProperty.roomTransactionOwnership.maxLength">
                This field cannot be longer than 16 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-transaction-property-roomUser">Room User</label>
            <input
              type="text"
              class="form-control"
              name="roomUser"
              id="room-transaction-property-roomUser"
              data-cy="roomUser"
              :class="{ valid: !$v.roomTransactionProperty.roomUser.$invalid, invalid: $v.roomTransactionProperty.roomUser.$invalid }"
              v-model="$v.roomTransactionProperty.roomUser.$model"
            />
            <div v-if="$v.roomTransactionProperty.roomUser.$anyDirty && $v.roomTransactionProperty.roomUser.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomTransactionProperty.roomUser.maxLength">
                This field cannot be longer than 8 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-transaction-property-roomPropertyRights">Room Property Rights</label>
            <input
              type="text"
              class="form-control"
              name="roomPropertyRights"
              id="room-transaction-property-roomPropertyRights"
              data-cy="roomPropertyRights"
              :class="{
                valid: !$v.roomTransactionProperty.roomPropertyRights.$invalid,
                invalid: $v.roomTransactionProperty.roomPropertyRights.$invalid,
              }"
              v-model="$v.roomTransactionProperty.roomPropertyRights.$model"
            />
            <div v-if="$v.roomTransactionProperty.roomPropertyRights.$anyDirty && $v.roomTransactionProperty.roomPropertyRights.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomTransactionProperty.roomPropertyRights.maxLength">
                This field cannot be longer than 16 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-transaction-property-roomSpareParts">Room Spare Parts</label>
            <input
              type="text"
              class="form-control"
              name="roomSpareParts"
              id="room-transaction-property-roomSpareParts"
              data-cy="roomSpareParts"
              :class="{
                valid: !$v.roomTransactionProperty.roomSpareParts.$invalid,
                invalid: $v.roomTransactionProperty.roomSpareParts.$invalid,
              }"
              v-model="$v.roomTransactionProperty.roomSpareParts.$model"
            />
            <div v-if="$v.roomTransactionProperty.roomSpareParts.$anyDirty && $v.roomTransactionProperty.roomSpareParts.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomTransactionProperty.roomSpareParts.maxLength">
                This field cannot be longer than 16 characters.
              </small>
            </div>
          </div>
        </div>
        <div>
          <button type="button" id="cancel-save" data-cy="entityCreateCancelButton" class="btn btn-secondary" v-on:click="previousState()">
            <font-awesome-icon icon="ban"></font-awesome-icon>&nbsp;<span>Cancel</span>
          </button>
          <button
            type="submit"
            id="save-entity"
            data-cy="entityCreateSaveButton"
            :disabled="$v.roomTransactionProperty.$invalid || isSaving"
            class="btn btn-primary"
          >
            <font-awesome-icon icon="save"></font-awesome-icon>&nbsp;<span>Save</span>
          </button>
        </div>
      </form>
    </div>
  </div>
</template>
<script lang="ts" src="./room-transaction-property-update.component.ts"></script>
